package cn.deschen.eshop.auth.enums;

import javax.validation.Valid;

/**
 * @Author hanbin_chen
 * @Description
 * @DateTime 2021/1/14 9:38
 * @Version V1.0.0
 */
public enum ValidateCodeTypeEnum {

    IMAGE("image"),
    SMS("sms"),

    ;

    /**
     * 类型对应名称
     */
    private String type;

    ValidateCodeTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static ValidateCodeTypeEnum codeTypeEnum(String type) {
        for (ValidateCodeTypeEnum codeTypeEnum:
        ValidateCodeTypeEnum.values()) {
            if (codeTypeEnum.getType().equals(type)) {
                return codeTypeEnum;
            }
        }
        return null;
    }

}
